Skip to content

refactor: uses built-in express validator functions instead of custom#2297

Merged
rsdmike merged 1 commit into
mainfrom
refactorValidator
Aug 27, 2025
Merged

refactor: uses built-in express validator functions instead of custom#2297
rsdmike merged 1 commit into
mainfrom
refactorValidator

Conversation

@rsdmike

@rsdmike rsdmike commented Aug 26, 2025

Copy link
Copy Markdown
Member

PR Checklist

  • Unit Tests have been added for new changes
  • API tests have been updated if applicable
  • All commented code has been removed
  • If you've added a dependency, you've ensured license is compatible with Apache 2.0 and clearly outlined the added dependency.

What are you changing?

Anything the reviewer should know when reviewing this PR?

If the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )

Copilot AI review requested due to automatic review settings August 26, 2025 21:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors validation logic by replacing custom regular expression validators with built-in express-validator functions for better maintainability and reliability.

  • Replaced custom regex patterns for IPv4, IPv6, and FQDN validation with express-validator's built-in methods
  • Simplified port validation using the built-in isPort() validator
  • Restructured validation logic to use conditional validation chains instead of a custom function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/routes/admin/proxy/proxyValidator.ts Outdated
@rsdmike
rsdmike force-pushed the refactorValidator branch from 5ea75c9 to 5128978 Compare August 26, 2025 22:14
graikhel-intel
graikhel-intel previously approved these changes Aug 26, 2025
Comment thread src/routes/admin/proxy/proxyValidator.ts
@rsdmike
rsdmike merged commit da373f5 into main Aug 27, 2025
9 checks passed
@rsdmike
rsdmike deleted the refactorValidator branch August 27, 2025 04:39
@RosieAMT

RosieAMT commented Oct 8, 2025

Copy link
Copy Markdown

🎉 This PR is included in version 2.28.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants